import request from '@/utils/request'

// 查询记账凭证列表
export function listFinRecordVoucher(query) {
  return request({
    url: '/project/FinRecordVoucher/list',
    method: 'get',
    params: query
  })
}

export function getMaxRecordNoFinRecordVoucher(recordTag,currentYear,currentMonth) {
  return request({
    url: '/project/FinRecordVoucher/getMaxRecordNo/'+recordTag+"/"+currentYear+"/"+currentMonth,
    method: 'get',
  })
}
// 查询记账凭证详细
export function getFinRecordVoucher(id) {
  return request({
    url: '/project/FinRecordVoucher/' + id,
    method: 'get'
  })
}

export function checkFinRecordVoucher(id,result) {
  return request({
    url: '/project/FinRecordVoucher/check/' + id+"/"+result,
    method: 'put'
  })
}

export function recordFinRecordVoucher(id) {
  return request({
    url: '/project/FinRecordVoucher/recordToBook/'+id,
    method: 'put'
  })
}

export function cancelRecordFinRecordVoucher(id) {
  return request({
    url: '/project/FinRecordVoucher/recordCancelToBook/'+id,
    method: 'put'
  })
}

// 新增记账凭证
export function addFinRecordVoucher(data) {
  return request({
    url: '/project/FinRecordVoucher',
    method: 'post',
    data: data
  })
}

// 修改记账凭证
export function updateFinRecordVoucher(data) {
  return request({
    url: '/project/FinRecordVoucher',
    method: 'put',
    data: data
  })
}

export function nextFinRecordVoucher(data) {
  return request({
    url: '/project/FinRecordVoucher/nextInfo',
    method: 'put',
    data: data
  })
}

export function preFinRecordVoucher(data) {
  return request({
    url: '/project/FinRecordVoucher/preInfo',
    method: 'put',
    data: data
  })
}

// 删除记账凭证
export function delFinRecordVoucher(id) {
  return request({
    url: '/project/FinRecordVoucher/' + id,
    method: 'delete'
  })
}
